package com.luania.todolist2.Model;

/**
 * Created by tyz1201 on 2016/4/1.
 */
public class TaskModel {
    String taskName;
    boolean isNeedNotify;
    String notifyTime;
    Long currentTime;

    public TaskModel(String notifyTime, String taskName, boolean isNeedNotify, Long currentTime) {
        this.notifyTime = notifyTime;
        this.taskName = taskName;
        this.isNeedNotify = isNeedNotify;
        this.currentTime = currentTime;
    }

    public String getTaskName() {
        return taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    public boolean isNeedNotify() {
        return isNeedNotify;
    }

    public void setIsNeedNotify(boolean isNeedNotify) {
        this.isNeedNotify = isNeedNotify;
    }

    public String getNotifyTime() {
        return notifyTime;
    }

    public void setNotifyTime(String notifyTime) {
        this.notifyTime = notifyTime;
    }

    public Long getCurrentTime() {
        return currentTime;
    }

    public void setCurrentTime(Long currentTime) {
        this.currentTime = currentTime;
    }

    public String toString() {
        return taskName + "/" + isNeedNotify + "/" + notifyTime+"/"+currentTime;
    }




    public static TaskModel backToString(String str) {
        String taskName;
        Boolean isNeedNotify;
        String notifyTime;
        Long currenttime;
        String[] strs = str.split("/");

        taskName = strs[0];
        isNeedNotify = Boolean.parseBoolean(strs[1]);
        notifyTime = strs[2];
        currenttime = Long.parseLong(strs[3]);

        TaskModel taskModel = new TaskModel(notifyTime, taskName, isNeedNotify,currenttime);
        return taskModel;

    }
}
